import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Dashboard.vue')
  },
  {
    path: '/products',
    name: 'products',
    component: () => import('../views/ProductsList.vue')
  },
  {
    path: '/product/:id',
    name: 'productDetail',
    component: () => import('../views/ProductDetail.vue')
  },
  {
    path: '/add-product',
    name: 'addProduct',
    component: () => import('../views/AddProduct.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
